from django.shortcuts import render
from rest_framework import viewsets,filters,pagination
from rest_framework import viewsets
from .models import Sso
from .serializers import SsoSerializers



# Create your views here.
class PageSet(pagination.PageNumberPagination):
    page_size = 3
    page_size_query_param = "size"
    max_page_size = 10
    page_query_param = "page"

class SsoViewSet(viewsets.ModelViewSet):
    queryset = Sso.objects.all().order_by('pk')
    serializer_class = SsoSerializers
    pagination_class = PageSet
    filter_backends = (filters.SearchFilter,filters.OrderingFilter,)
    search_fields = ('=name')
    ordering_fields = ('name')
